Skip to content

chore(logs): include account_id and chunk_production_key in chunk-endorsement error#15634

Merged
wacban merged 3 commits intomasterfrom
waclaw/chunk-endorsement-error-details
Apr 28, 2026
Merged

chore(logs): include account_id and chunk_production_key in chunk-endorsement error#15634
wacban merged 3 commits intomasterfrom
waclaw/chunk-endorsement-error-details

Conversation

@wacban
Copy link
Copy Markdown
Contributor

@wacban wacban commented Apr 24, 2026

Helps attribute InvalidChunkEndorsement at INFO level without enabling debug logs for the stateless_validation target.

Seen via alert:
https://grafana.nearone.org/a/grafana-irm-app/alert-groups/IKHSU3P2Q5YG4

…orsement error

Helps attribute InvalidChunkEndorsement at INFO level without enabling
debug logs for the stateless_validation target.

Seen via alert:
https://grafana.nearone.org/a/grafana-irm-app/alert-groups/IKHSU3P2Q5YG4
Copilot AI review requested due to automatic review settings April 24, 2026 10:42
@wacban wacban requested a review from a team as a code owner April 24, 2026 10:42
@wacban wacban requested a review from saketh-are April 24, 2026 10:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves observability for chunk-endorsement processing failures by adding identifying context (validator account_id and chunk_production_key) to the client error log, making it easier to attribute InvalidChunkEndorsement events without enabling verbose stateless_validation debug logs.

Changes:

  • Extract account_id and chunk_production_key from incoming ChunkEndorsementMessage.
  • Include these fields in the tracing::error! event emitted when processing the endorsement fails.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +10 to +13
let endorsement = msg.0;
let account_id = endorsement.account_id().clone();
let key = endorsement.chunk_production_key();
if let Err(err) = self.chunk_endorsement_tracker.process_chunk_endorsement(endorsement) {
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 60.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.53%. Comparing base (1785346) to head (b85d508).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
chain/client/src/chunk_endorsement_handler.rs 50.00% 3 Missing ⚠️
...src/stateless_validation/state_witness_producer.rs 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #15634      +/-   ##
==========================================
- Coverage   69.55%   69.53%   -0.02%     
==========================================
  Files         940      940              
  Lines      214385   214389       +4     
  Branches   214385   214389       +4     
==========================================
- Hits       149109   149078      -31     
- Misses      59361    59397      +36     
+ Partials     5915     5914       -1     
Flag Coverage Δ
pytests-nightly 1.14% <0.00%> (-0.01%) ⬇️
unittests 68.98% <60.00%> (-0.01%) ⬇️
unittests-nightly 69.08% <60.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Avoids an AccountId clone (heap alloc + memcpy) on every received
endorsement, and lets the error log read account_id/key directly off
the still-owned value at the call site.
@wacban wacban changed the title log(client): include account_id and chunk_production_key in chunk-endorsement error chore(logs): include account_id and chunk_production_key in chunk-endorsement error Apr 24, 2026
@wacban wacban requested review from Wiezzel and jancionear and removed request for saketh-are April 24, 2026 11:54
target: "client",
?err,
account_id = %endorsement.account_id(),
key = ?endorsement.chunk_production_key(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In early validator kickout we're moving away from the ChunkProductionKey. Not sure if it makes sense to include it, it might get removed a moment later. /cc @stedfn

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is fine, it will take a while longer than a moment

Copy link
Copy Markdown
Contributor

@Wiezzel Wiezzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wacban wacban added this pull request to the merge queue Apr 28, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 28, 2026
@wacban wacban added this pull request to the merge queue Apr 28, 2026
Merged via the queue into master with commit 50b343f Apr 28, 2026
30 of 32 checks passed
@wacban wacban deleted the waclaw/chunk-endorsement-error-details branch April 28, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants